Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Displaying Rendered • View rawDownload


docs/agents/skills/landlock-sqlite/SKILL.md 8522a5fd9eee9dd0e2dd6a587fa55fe6a624a9ae (8522a5fd) Text, 1.77 KB

Skill: landlock-sqlite

Landlock + SQLite conversation-load failures (temp_store, slim queries, memory pressure).

MeshChatX Landlock + SQLite

Symptoms

• T383838/api/v1/lxmf/conversations or T383838/api/v1/notifications return 500/503
• Logs show T383838sqlite3.OperationalError: unable to open database file
• Happens after Landlock enables, often with large message T383838fields / base64 blobs

Root causes (priority order)

1. Worker-thread connections missing T383838PRAGMA temp_store=MEMORY (T383838DatabaseProvider._configure_connection)
2. Conversation SELECT pulling full T383838content / T383838fields
3. Memory-pressure switching to T383838temp_store=FILE under Landlock
4. Identity context not ready (should be 503, not 500)

Required behavior

• Default: T383838temp_store=MEMORY on every new connection
• Landlock active + memory pressure: shrink cache/mmap, keep MEMORY temp
• Non-Landlock memory pressure may use FILE temp + storage-local T383838sqlite-tmp TMPDIR
• List queries: T383838substr(content, 1, 240) and SQL T383838instr flags for attachments
• API: map OperationalError / unable-to-open / locked to 503 with retryable message

Verification

T282828
uv run pytest tests/backend/test_sqlite_landlock_temp_store.py tests/backend/test_sqlite_memory_pressure.py tests/backend/test_landlock_sandbox.py -q

For live stress, run Landlock in a subprocess (sandbox applies once per process). Expect FILE temp complex queries to fail under Landlock. MEMORY must pass.

Key files

• T383838meshchatx/src/backend/database/provider.py
• T383838meshchatx/src/backend/database/__init__.py
• T383838meshchatx/src/backend/memory_pressure.py
• T383838meshchatx/src/backend/message_handler.py
• T383838meshchatx/src/backend/landlock_sandbox.py
• T383838meshchatx/meshchat.py (conversations/notifications error mapping)


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────